<!DOCTYPE html>
<html>
<head>
    <title>用户评分统计</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="description" content="木兰湾管理系统">
    <script type="text/javascript" src="../../static/include/header-css.js"></script>
</head>
<body>
<!--导航-->
<div class="weui-tab" style="height:44px;"   id="userScoreTab">
    <div class="weui-tab-nav">
        <a href="javascript:setPeriodAndSearch(7);" class="weui-navbar__item weui-nav-green"> 最近7天 </a>
        <a href="javascript:setPeriodAndSearch(30);" class="weui-navbar__item weui-nav-green"> 最近一个月</a>
        <a href="javascript:setPeriodAndSearch(365);" class="weui-navbar__item weui-nav-green"> 最近一年</a>
    </div>
</div>
<div>
    <form id="search-form">
        <input type="text" style="display:none;" name='period' id="period" value="7"/>
    </form>
</div>
<!--数据显示-->
<div id="container"
     style="width: 100%; height: 65%; margin: 0 auto">
</div>

<br>
<div class="button_sp_area" align="center">
    <a href="javascript:scroll(0,0);" class="weui-btn weui-btn_mini weui-btn_primary">返回顶部</a>
</div>
<br>
<script type="text/javascript" src="../../static/include/footer-js.js"></script>
<script type="text/javascript" src="../../static/js/echarts/echarts.min.js"></script>
<script type="text/javascript" src="../../static/js/echarts/mulanbaychart.js"></script>
<!--顶部导航使用-->
<script type="text/javascript" src="../../static/js/iscroll-lite.min.js"></script>
<script>
    $(function() {
        var period = getQueryVariable('period');
        if(period==null){
            period = 7;
        }
        var index=0;
        if(period == 30){
            index=1;
        }
        $('#period').val(period);
        $('#userScoreTab').tab({defaultIndex:index,activeClass:"bg-green"});
        userScoreStat();
    });
    function setPeriodAndSearch(period) {
        $('#period').val(period);
        userScoreStat();
    }
    function userScoreStat() {
        var period = $('#period').val();
        var para = {
            startDate:getDay(0-period),
            endDate:getNowDateString(),
            chartType:'LINE'
        };
        var url = '/userScore/stat';
        doAjax(para, url, 'GET',false, function(data) {
            data.title='用户评分统计';
            data.subTitle='';
            data.showMarkPoint=true;
            data.showMarkLine=true;
            createLineData(data);
        });
    }
</script>
</body>
</html>